/*
 * @Description: 地图相关接口
 * @Author: Yong
 * @Date: 2021-09-24 22:16:52
 * @LastEditTime: 2021-09-27 15:32:03
 */
import {Http} from '../utils'

const API = {
    getAreaInfo: '/area/info',
    getAreaMap: '/area/map',
    getHouseList: '/houses'
}

/**
 * 获取城市名称和ID
 * @param name 城市名称
 */
export const getAreaInfo = function (name) {
    return Http('get', API.getAreaInfo, { name: name })
}

/**
 * 获取房源信息列表
 * @param id 当前城市ID
 */
export const getAreaMap = function (id) {
    return Http('get', API.getAreaMap, { id })
}

/**
 * 根据条件查询房屋
 * @param params 查询条件 - { cityId: '', .... }
 */
export const getHouseList = function (params) {
    return Http('get', API.getHouseList, params)
}